﻿<UserControl x:Class="ZumtenSoft.WpfUtils.Samples.TreeSample.TreeSampleControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:local="clr-namespace:ZumtenSoft.WpfUtils.Samples.TreeSample" mc:Ignorable="d">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="25" />
            <RowDefinition Height="25" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="50" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="100" />
        </Grid.ColumnDefinitions>
        <TreeView Name="lstStudents" Grid.ColumnSpan="4" SelectedItemChanged="LstStudents_OnSelectedItemChanged">
            <TreeView.ItemTemplate>
                <HierarchicalDataTemplate ItemsSource="{Binding Path=Nodes}">
                    <TextBlock Text="{Binding Path=Name}" />
                </HierarchicalDataTemplate>
            </TreeView.ItemTemplate>
        </TreeView>

        <TextBlock Text="Name:" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="2" />
        <TextBox Name="txtName" Grid.Row="1" Grid.Column="1" Margin="2" />

        <TextBlock Text="Score:" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="2" />
        <TextBox Name="txtScore" Text="100" local:TextBoxHelpers.IsNumeric="True" Grid.Row="2" Grid.Column="1" Margin="2" />

        <Button Name="btnUpdate" Content="Update" Grid.Row="1" Grid.Column="2" Margin="2" Click="btnUpdate_OnClick" />
        <Button Name="btnCreate" Content="Create" Grid.Row="2" Grid.Column="2" Margin="2" Click="btnCreate_OnClick" />
    </Grid>
</UserControl>
